//
//  BHCompetitionRelationReportCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/15.
//

import UIKit

class BHCompetitionRelationReportCell: UITableViewCell {

    @IBOutlet weak var time_label: UILabel!
    
    @IBOutlet weak var title_label: UILabel!
    
    @IBOutlet weak var image_news: UIImageView!
    
    @IBOutlet weak var content_label: UILabel!
    
    
    var model: BHCompetitionReportModel? {
        didSet {
            if model == nil {
                return
            }
            
            self.time_label.text = model!.createTime
            self.title_label.text = model!.title
            
            self.content_label.isHidden = true
            self.image_news.isHidden = true
            
            if model!.abstracts == 2 { // 文字
                self.content_label.isHidden = false
                self.content_label.attributedText = model!.showTextAttribute
            }else {
                self.image_news.isHidden = false
                self.image_news.sd_setImage(with: URL.init(string: model!.url), completed: nil)
            }
            
        }
    }
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
